package com.qf.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Transient;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.InnerField;
import org.springframework.data.elasticsearch.annotations.MultiField;

import java.io.Serializable;
import java.util.List;

/**
 * (Room)实体类
 *
 * @author makejava
 * @since 2020-09-20 22:28:36
 */
@Data
@Accessors(chain = true)
public class Room implements Serializable {
    @TableId(type = IdType.AUTO)
    @Field(type = FieldType.Integer,index = false)
    @Excel(name = "客房id")
    private Integer id;
    @Field(type = FieldType.Integer,index = false)
    @Excel(name = "酒店id")
    private Integer hid;
    @MultiField(
            mainField = @Field(type = FieldType.Text,analyzer = "ik_max_word"),
            otherFields = @InnerField(type = FieldType.Text,analyzer = "pinyin", suffix="pinyin")
    )
    @Excel(name = "客房标题")
    private String title;
    @Field(type = FieldType.Keyword,index = false)
    @Excel(name = "客房面积")
    private String area;
    @Transient
    @Excel(name = "容纳人数")
    private Integer num;
    @Field(type = FieldType.Keyword,index = false)
    private String image;
    @MultiField(
            mainField = @Field(type = FieldType.Text,analyzer = "ik_max_word"),
            otherFields = @InnerField(type = FieldType.Text,analyzer = "pinyin", suffix="pinyin")
    )
    @Excel(name = "客房信息")
    private String info;
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    @Excel(name = "床型")
    private String bed;
    @Field(type = FieldType.Integer,index = false)
    @Excel(name = "客房数量")
    private Integer number;
    @Field(type = FieldType.Double,index = false)
    @Excel(name = "客房价格")
    private double price;
    @Field(type = FieldType.Nested)
    @TableField(exist = false)
    private List<RoomPrice> prices;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getHid() {
        return hid;
    }

    public void setHid(Integer hid) {
        this.hid = hid;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public String getBed() {
        return bed;
    }

    public void setBed(String bed) {
        this.bed = bed;
    }

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

}